import Vue from 'vue'
import App from './App.vue'

import VueRouter from 'vue-router'

Vue.config.productionTip = false
Vue.use(VueRouter)

import Find from './views/Find.vue'
import My from './views/My.vue'
import Friend from './views/Friend.vue'
import _404 from './views/404.vue'

const routes = [
  {// 监听默认路由，路径是  /
    path: '/', // 根路径
    redirect: '/find',// 重定向
  }, {
    path: '/find',
    component: Find,
  }, {
    path: '/my',
    component: My
  }, {
    path: '/friend',
    component: Friend
  }, {// 404配置
    path: '*',
    component: _404
  },
]
const router = new VueRouter({
  routes,
  mode: 'history'// 历史模式，url后不显示#
})

new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
